import axios from "axios";

const token = sessionStorage.getItem("authentication");

export const getShoppingCartList = (params: any) =>
    axios({
        url: "api/user/shoppingCart/list",
        method: 'get',
        headers: {authentication: token},
        params: params
    })

export const getShoppingCartSum = () =>
    axios({
        url: "api/user/shoppingCart/count",
        method: 'get',
        headers: {authentication: token},
    })


export const addShoppingCart = (data: any) =>
    axios({
        url: "api/user/shoppingCart/add",
        method: 'post',
        headers: {authentication: token},
        data: data
    })

export const deleteShoppingCart = (data: any) =>
    axios({
        url: "api/user/shoppingCart/sub",
        method: 'delete',
        headers: {authentication: token},
        data: data
    })


export const deleteBatchShoppingCart = (ids: string) =>
    axios({
        url: `api/user/shoppingCart/delete/${ids}`,
        method: 'delete',
        headers: {authentication: token},
    })
